$(function() {
	/**
 * [isMobile 判断平台,决定是否移除返回标签]
 */
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if(isiOS){
	$(".bar-nav").remove();
	$(".book-intro").attr("data-offset",0);
}

	//首页
	$(document).on("pageInit", "#index", function(e, id, page) {
		$("title").text("品牌推荐");
		new Swiper('.ad_top', {
			pagination: '.swiper-pagination',
			paginationClickable: true,
			spaceBetween: 12
		});
		new Swiper('.hot-product', {
			pagination: null,
			spaceBetween: 12,
			slidesPerView: 3.3,
			spaceBetween: 12,
			freeMode: true,
			autoplay: 2500
		});
	})
	
	$(document).on("pageInit", "#pro-list", function(e, id, page) {
		$("title").text("产品列表");
		//排序菜单
		$(".list-menu").on("click", function() {
			$(".list-menu-box").toggleClass("list-menu-box-fDown");
		});
		$(".list-menu-box li").on("click", function() {
			var that = $(this);
			that.addClass("active").siblings().removeClass("active");
			var curVal = that.text();
			$(".list-menu-val").text(curVal);
			$(".list-menu-box").removeClass("list-menu-box-fDown");
			console.log(curVal);
		});
	})
	
	$(document).on("pageInit", "#pro-detail", function(e, id, page) {
		$("title").text("产品详情");
		//点赞效果
		$(".pro-collect").click(function(){
			var that=$(".pro-collect i");
			that.addClass("tobig");
		});
		//微信拨打电话处理
		var phoneNum=$(".call span").text();
		$(".call").attr("href","tel:"+phoneNum)
		console.log($(".call").attr("href"));
		
	})

	$.init();
})